package net.gxf.check;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;


public class MainUI extends JFrame {

	private static final long serialVersionUID = 1L;
	private final String DEFAULT_LOCATION = "C:/ETF";// 默认的下载ETF位置

	public MainUI() {
		this.setSize(500, 60);
		this.setLocationRelativeTo(null);
		this.setTitle("Debug");
		// this.setUndecorated(true);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		this.setVisible(true);
	}

	private void run() {
		JProgressBar progressBar = new JProgressBar();
		// 显示界面
		progressBar.setValue(0);
		progressBar.setStringPainted(true);
		progressBar.setString("正在生成数据，请稍等....");
		progressBar.setIndeterminate(true);
		// this.add(progressBar,BorderLayout.NORTH);
		this.add(progressBar);
		// 处理
		SH_PaseStockAnalysis paAnalysis = new SH_PaseStockAnalysis();
		paAnalysis.run();
		paAnalysis.result();
		progressBar.setVisible(false);
		JOptionPane.showMessageDialog(this, "数据导出位置"+DEFAULT_LOCATION, "完成", JOptionPane.INFORMATION_MESSAGE);
		this.dispose();

	}

	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		MainUI mainUI = new MainUI();
		mainUI.run();
	}

}
